package com.chance.cc.crawler.prod.command.trigger.domain.news.baidu;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.baidu.BaiDuCommonScript;
import com.chance.cc.crawler.prod.command.job.domain.news.baidu.baijiahao.BaiDuBJHSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.baidu.tieba.adhoc.BaiDuTieBaSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.baidu.tieba.trace.BaiDuTieBaTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.news.baidu.tieba.trace.BaiDuTopicTraceCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-23 14:16:52
 * @email okprog@sina.com
 */
public class BaiDuSimpleCrawlerScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
//        publishBaiDuSimpleScheduleTriggerInfo(BaiDuTieBaSimpleCrawlerSchedulerJob.crawlerScheduler());
//        publishBaiDuSimpleScheduleTriggerInfo(BaiDuBJHSimpleCrawlerSchedulerJob.crawlerScheduler());

        publishBaiDuSimpleScheduleTriggerInfo(BaiDuTieBaTraceCrawlerSchedulerJob.crawlerScheduler());
        publishBaiDuSimpleScheduleTriggerInfo(BaiDuTopicTraceCrawlerSchedulerJob.crawlerScheduler());
    }

    public static void publishBaiDuSimpleScheduleTriggerInfo(CrawlerJob crawlerJob){
        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                BaiDuCommonScript.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "百度贴吧临时采集任务");
    }
}
